-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FPGA prototyping platform VCS simulation #871
Conversation
…permanent fix since we do want this tied off for hardware.
… of adding a case in Simulator.scala for a new simulation variable, arty. This can change later.
…cies with includes in build.sbt. Will be changed later.
…mulation libraries. Next, sim-fpga target will include the VCS MX flow commands.
… rules for VCS MX flow.
… described in issue, but it can now be replicated.
…ar project dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, a good start. It might be worth it to add a Makefile check for Vivado versions (what Vivado version are you using?).
Thanks for your review and comments, Abe. I have added a Makefile variable |
@@ -14,6 +14,9 @@ sim_name := none | |||
######################################################################################### | |||
# include shared variables | |||
######################################################################################### | |||
|
|||
VIVADO_VERSION := $(shell vivado -version | head -1 | grep -o -P '(?<=\s).*(?=\s)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Vivado isn't on the path this pollutes the terminal output. Maybe pipe stderr to /dev/null
. Also, where is this checked/used?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…eset switch on the dev board.
…t module in fpga-shells depends on it, and sim config does not include JTAG module.
end | ||
|
||
`MODEL testHarness( | ||
.CLK100MHZ(clock), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can avoid duplicating this file by creating a new Shell called something like ChipyardArtyShell
which 1 instantiates the current ArtyShell
but also renames the CLK100MHz
-> clock
and ck_rst
-> reset
(and also does the negation within it). Maybe this can also be done w/ the fancier diplomatic Arty100TShell
if we don't want to hack around w/ this basic shell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's best to avoid keeping excess collateral files like this around. Seems like it would be a good solution to create a new shell and rename to conform to the stock CY TestDriver. I'll look at that but will want to make sure that nothing in fpga-shells depends on these names. I haven't looked as much at the diplomatic Arty100TShell but will do so. I think it would be best to make Arty diplomatic to bring it in line with the VCU118 shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, if the test driver is the same and the tcl scripts are generalized... then I should be able to port this work to test the VCU118. Then if that works, I can probably add both of these tests into CI.
This is now working. Users with Vivado and VCS in their paths can run
in the You can then pass a program to the generated binary as with the standard RTL sim flow. |
Related issue: #820
Type of change: new feature
Impact: software change
Release Notes
This PR contains a draft of FPGA prototyping sim support. It currently targets Arty, but I have tried to generalize the flow such that it should be able to target the VCU118 with minor changes.
The sim binary builds, but exhibits the same behavior described in #820, so please do not merge. However, I wanted to get in a PR so that the behavior can be reproduced with a make target. In that issue, the sim binary is missing the program-as-argument functionality given in testchip_tsi.cc. David suggested looking into
+permissive_on/off
flags, which I will do next.To summarize what this PR contains, I have added a
sim-fpga
target infpga/Makefile
that runs a .tcl script,/fpga/scripts/generate_vcs_collateral.tcl
, to generate Vivado behavioral sim collateral for VCS. It then runs through the VCS mixed-language flow, analyzing the Verilog and VHDL, then elaborating the simulation binary.I will definitely do a lot of cleanup before merging this. Partcularly de-duplication between this Makefile and some things in
vcs.mk
that were hard-coded. Also figuring out a cleaner way to bring in an FPGA-specific testdriver, which for now uses an additional case ingenerators/utilities/src/main/scala/Simulator.scala
for a newsim_name
.To run: